//
//  WCNVariableCell.m
//  WCN
//
//  Created by wsj2015 on 15/9/16.
//  Copyright (c) 2015年 ShanghaiCize Trade And Business Co., Ltd. All rights reserved.
//

#import "WCNVariableCell.h"
#import "UILabel+Utilities.h"

@implementation WCNVariableCell
{
    CGFloat _h;

}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)configWith:(NSString *)contenStr
{
//    contenStr =@"寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命寿命";
    CGRect frame =self.notLabel.frame;
    CGFloat h =[contenStr boundingRectWithSize:CGSizeMake(274, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15] } context:nil].size.height;
    if (h >44) {
        
        _h =h -frame.size.height;
        frame.size.height =h;
    }else{
        _h =0;
        frame.size.height =44;
    }
    self.notLabel.frame =frame;
    self.notLabel.font =[UIFont systemFontOfSize:15];

    self.notLabel.text =contenStr;
    
    [self.notLabel showAttributedText:0 lineSpace:0];

}
- (CGFloat)cellHeight
{
    CGFloat cellH = 78;
    if (_h) {
        cellH +=_h;
    }
    return cellH;

}



@end
